Page2.js/**
 * Created by Administrator on 2017/3/2 0002.
 */
var Page4={
    create:function () {
    var page={};
        page.ui=new PIXI.DisplayObjectContainer();
        var bg0=Easy.CreateSprite('assets/images/p4_i0.png',0,0,0,0,1);
        page.ui.addChild(bg0);
        var bg1=Easy.CreateSprite('assets/images/p4_i1.png',0,0,0,0,0);
        page.ui.addChild(bg1);
        var bg2=Easy.CreateSprite('assets/images/p4_i2.png',1136/2,640/2,0.5,0.5,0);
        page.ui.addChild(bg2);

        var cover=new PIXI.Graphics();
        cover.beginFill(0x0,1);
        cover.drawRect(0,0,1136,1136);
        cover.alpha=0;
        cover.endFill();
        page.ui.addChild(cover);

        var t0=Easy.CreateSprite('assets/images/p4_t0.png',470,122,0.5,0.5,0);
        page.ui.addChild(t0);
        var t1=Easy.CreateSprite('assets/images/p4_t1.png',470,240,0.5,0.5,0);
        page.ui.addChild(t1);
        var t2=Easy.CreateSprite('assets/images/p4_t2.png',863,441,0.5,0.5,0);
        page.ui.addChild(t2);
        
        page.In=function () {
            console.log('in');
            bg0.alpha=1
            cover.alpha=0
            bg1.alpha=bg2.alpha=0;

            t2.scale.x=t2.scale.y=3;
            t0.alpha=0;
            t1.alpha=0;
            t2.alpha=0;
            t0.x=470+200;
            t1.x=470+200;

            TweenMax.to(bg1,1,{delay:1,alpha:1});
            TweenMax.to(bg2,1,{delay:2,alpha:1});
            TweenMax.to(cover,1,{delay:3,alpha:0.5});

            TweenMax.to(t0,0.7,{delay:3.5,x:470,alpha:1,ease:Cubic.easeInOut});
            TweenMax.to(t1,0.7,{delay:4.0,x:470,alpha:1,ease:Cubic.easeInOut});
            TweenMax.to(t2,0.3,{delay:4.7,alpha:1,ease:Cubic.easeInOut});
            TweenMax.to(t2.scale,0.3,{delay:4.7,x:1,y:1,ease:Cubic.easeIn});

            TweenMax.to(bg2.scale,0.03,{delay:5,x:1.02,y:1.02,repeat:3,ease:Cubic.easeIn,onComplete:function () {
                bg2.scale.x=1;
                bg2.scale.y=1;
            }});
        }
        page.Out=function () {
            console.log('out');
            TweenMax.killTweensOf(bg1);
            TweenMax.killTweensOf(bg2);
            TweenMax.killTweensOf(cover);
            TweenMax.killTweensOf(t0);
            TweenMax.killTweensOf(t1);
            TweenMax.killTweensOf(t2);
            TweenMax.killTweensOf(page.ui);
            setTimeout(function () {
                t0.alpha=0;
                t1.alpha=0;
                t2.alpha=0;
                bg0.alpha=1
                cover.alpha=0
                bg1.alpha=bg2.alpha=0;
            })

        }

       
    return page;
    }
}